<?php

/**
 * @version: 1.5
 * @Project: MightMedia TVS
 * @Puslapis: www.coders.lt
 * @$LastChangedBy$
 * @copyright CodeRS ©2009
 * @license GNU General Public License v2
 * @$LastChangedRevision$
 * @$LastChangedDate$
 * @$HeadURL$
 **/

//Pradiniai nustatymai
define('__CFG_ROOT', realpath(dirname(__FILE__)).'/');
define("__CFG_HTTP_ROOT", "http://".$_SERVER["HTTP_HOST"].preg_replace("/[^\/]*$/","",$_SERVER["PHP_SELF"]));

//Inicijuojam pradinius veiksmus
include(__CFG_ROOT . 'priedai/main.php');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');	//Klaidu pranesimai On/Off


//Uzkraunam pagrindus
include (__CFG_ROOT . 'priedai/funkcijos.php');
//include(__CFG_ROOT . "/includes/config.php");

$db = new mysql('localhost','root','','coders',true);

/** testing */
print_r($_GET);
$sql = $db->getRows('select * from projects');
$sql = $db->getRows('select * from projects');
$sql = $db->getRows('select * from projects');

echo $db->numQueries();
echo $db->lastQuery();
/** end testing */

$tpl = new Smarty;

$tpl->compile_check = true;
$tpl->debugging = true;

/** template dir */
$style = 'default';

$tpl->config_dir = __CFG_ROOT . 'stiliai/' . $style . '/configs/';
$tpl->template_dir = __CFG_ROOT . 'stiliai/' . $style . '/';
$tpl->compile_dir = __CFG_ROOT . 'temp/';
$tpl->cache_dir = __CFG_ROOT . 'temp/';

$tpl->assign('basehref',__CFG_HTTP_ROOT);
$tpl->assign('style',__CFG_HTTP_ROOT . 'stiliai/' . $style . '/');

$tpl->display('index.html');

?>
